/**
 * Hackystat Version 8 Framework
 * Sensor Data Viewer Widget
 */
package org.hackystat.ui.sensordatabrowser.client.common;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.RemoteService;

/**
 * Remote procedure call interface for getting sensor data from a RESTlet sensorbase server. Returns
 * a formatted description of the sensor data over the requested interval.
 * 
 * @author David J. Nickles
 */
public interface RPCRemoteService extends RemoteService {

  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * 
   * @param host the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param timestampString XML-format time stamp for start of data interval
   * @return String Description of the requested sensor data
   * @throws RPCException If problems occur during the remote procedure call
   * 
   * @gwt.typeArgs <java.util.ArrayList<org.hackystat.ui.sensordatabrowser.client.common.Event>>
   */
  public ArrayList getDaySummary(String host, String project, String user, String password, 
      String timestampString) throws RPCException;

  /**
   * Returns the index of all Projects from this server for this user..
   * @param uri the URI for the SensorBase.
   * @param user username (email address) for authentication.
   * @param password user password for authentication.
   * @return Returns the index of all Projects from this server for this user.
   * @throws RPCException if problems occur during the Sensorbase procedure call.
   * 
   * @gwt.typeArgs <org.hackystat.ui.sensordatabrowser.client.common.ProjectParcel>
   */
  public ArrayList getProjectParcels(String uri, String user, String password)
    throws RPCException;
      
  /**
   * Return a formatted description of the requested sensor data within the specified event.
   * 
   * @param uri the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param event to get items within
   * @param reqPage the requested page.
   * @return EventItemsPage of the requested sensor data.
   * @throws RPCException if problems occur during the Sensorbase procedure call
   */
  public EventItemsPage getEventItems(String uri, String project, String user, String password, 
    Event event, EventItemsPage reqPage) throws RPCException;
    
  /**
   * Returns the host uri from the properties file.
   * 
   * @return String the host uri.
   */
  public String getHost(); 
  
  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * @param uri the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param year of interval
   * @param month of interval
   * @return Boolean array of days with data
   * @throws RPCException if problems occur during the Sensorbase procedure call
   * 
   * @gwt.typeArgs <java.lang.Boolean>
   */
  public ArrayList getOverview(String uri, String project, 
    String user, String password, int year, int month) throws RPCException;

  /**
   * Returns true if the passed host is a SensorBase host.
   * 
   * @param host the URI for the SensorBase
   * @return Boolean indicating if the host is a valid sensorbase
   */
  public Boolean isHost(String host);

  /**
   * Returns true if the user and password is registered as a user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @param password key for authentication
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean isRegistered(String host, String user, String password);

  /**
   * Registers the user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean registerUser(String host, String user);
  
  /**
   * Returns the version number from the Manifest file.
   * 
   * @return String the version number from the Manifest file.
   */
  public String version(); 
}
